package com.isoftstone.project.system.service.impl;


import com.isoftstone.project.system.mapper.SysUserRoleMapper;
import com.isoftstone.project.system.service.ISysUserRoleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class SysUserRoleService implements ISysUserRoleService {
	@Autowired
	SysUserRoleMapper sysUserRoleMapper;

	@Override
	public void saveUserRole(String userId, String roleId) throws Exception {
		sysUserRoleMapper.saveUserRole(userId,roleId);
	}

	@Override
	public void deleteByroleId(String roleId) throws Exception {
		sysUserRoleMapper.deleteByroleId(roleId);
	}

	@Override
	public void deleteByUserId(String userId) {
		sysUserRoleMapper.deleteByUserId(userId);
	}

	@Override
	public List<String> getRolesByUserId(String userId) throws Exception {
		return sysUserRoleMapper.getRolesByUserId(userId);
	}

	@Override
	public List<String> getRolesByroleId(String roleId) throws Exception {
		return sysUserRoleMapper.getRolesByroleId(roleId);
	}

	@Override
	public List<String> getAppsByUserId(String userId) throws Exception {
		return sysUserRoleMapper.getAppsByUserId(userId);

	}
}
